package com.cweb.admin.model.bbs.bbs_user_to_article.controller;


import com.cweb.admin.model.bbs.bbs_user_to_article.service.BbsUserToArticleService;
import com.cweb.framework.annotation.Remark;
import com.cweb.framework.base.controller.BaseController;
import com.cweb.framework.pojo.BaseResponse;
import com.cweb.framework.pojo.CustomException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 论坛-用户收藏文章 前端控制器
 *
 * @author changfan
 */
@RestController
@RequestMapping("bbs/favor")
public class BbsUserToArticleController extends BaseController {
    @Autowired
    private BbsUserToArticleService bbsUserToArticleService;

    @RequestMapping("add")
    @Remark(name = "新增收藏", describe = "")
    public BaseResponse add(Long articleId) throws CustomException {
        return new BaseResponse(bbsUserToArticleService.add(articleId));
    }
    @RequestMapping("cancel")
    @Remark(name = "取消收藏", describe = "")
    public BaseResponse cancel(Long articleId) throws CustomException {
        return new BaseResponse(bbsUserToArticleService.cancel(articleId));
    }
}

